package com.slj.springcloud.controller;

import com.slj.springcloud.client.PayClient;
import com.slj.springcloud.model.dto.PayDTO;
import com.slj.springcloud.model.response.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/order")
@Slf4j
public class OrderController {
    @Autowired
    private PayClient payClient;

    @GetMapping("/pay")
    public Result<List<PayDTO>> findPay() {
        return payClient.findAll();
    }

    @GetMapping("/port")
    public Result<String> getPort() {
        return payClient.getPort();
    }

    @GetMapping("/timeout")
    public Result<String> timeout() {
        return payClient.timeout();
    }
}
